CONST
	WALKSPEED = 4;
	JUMPSPEED = -10;
	
	GRAVITY = 5;
END

FUNCTION int updateSpeed( string currentState)
BEGIN
	SWITCH ( currentState )
		CASE WALKING:
			
			return WALKSPEED;
			
		END
		CASE JUMPING:
			
			return JUMPSPEED;
			
		END
		
	END	// switch
	return 0;
END 

FUNCTION int applyGravity (int speedY)
BEGIN
	speedY += GRAVITY;
	return speedY;
END 